import axios from '@/request/http'
import { commonOutDTO, pageCommonInputDTO, pageCommonOutDTO } from '@/api/common.d'
import {
  GdjdtzsCreateInputDTO,
  GdjdtzsAddInputDTO,
  GdjdyjlbQueryParam,
  GdjdyjlbQueryResult,
  FkjgSaveInputDTO,
  FkyjsCreateInputDTO,
  SqfhSaveInputDTO,
  FhsqsCreateInputDTO,
  FjxxQueryParam,
  FjxxQueryResult,
  FjxxDeleteInputDTO,
  FhjgUpdateInputDTO,
  JsjdUpdateInputDTO,
  JxjdSaveInputDTO,
  CldmxGetInputDTO,
  CldmxGetOutputDTO,
  LxlbQueryResult,
  GdjdyjfklbQueryParam,
  GdjdyjfklbQueryResult,
  FjUploadInputDTO,
} from './jdfk-dto'

export default class jdfkService {
  /**
   * 创建归档监督通知书
   */
  static createGdjdtzs(data: GdjdtzsCreateInputDTO): Promise<commonOutDTO<any>> {
    return axios.post('/api/jdgl/createGdjdtzs', data, { responseType: 'blob' })
  }

  /**
   * 新增归档监督通知书
   */
  static addGdjdtzs(data: GdjdtzsAddInputDTO): Promise<commonOutDTO<any>> {
    return axios.post('/api/jdgl/addGdjdtzs', data)
  }

  /**
   * 查询归档监督预警列表
   */
  static queryGdjdyjlb(
    data: pageCommonInputDTO<GdjdyjlbQueryParam>,
  ): Promise<commonOutDTO<pageCommonOutDTO<GdjdyjlbQueryResult[]>>> {
    return axios.post('/api/jdgl/queryGdjdyjjllb', data)
  }

  /**
   * 保存反馈结果
   */
  static savaFkjg(data: FkjgSaveInputDTO): Promise<commonOutDTO<any>> {
    return axios.post('/api/jdgl/savaFkjg', data)
  }

  /**
   * 创建反馈意见书
   */
  static createFkyjs(data: FkyjsCreateInputDTO): Promise<commonOutDTO<any>> {
    return axios.post('/api/jdgl/createFkyjs', data, { responseType: 'blob' })
  }

  /**
   * 申请复核
   */
  static saveSqfh(data: SqfhSaveInputDTO): Promise<commonOutDTO<any>> {
    return axios.post('/api/jdgl/saveSqfh', data)
  }

  /**
   * 创建复核申请书
   */
  static createFhsqs(data: FhsqsCreateInputDTO): Promise<commonOutDTO<any>> {
    return axios.post('/api/jdgl/createFhsqs', data, { responseType: 'blob' })
  }

  /**
   * 获取附件信息
   */
  static queryFjxx(data: FjxxQueryParam): Promise<commonOutDTO<FjxxQueryResult[]>> {
    return axios.post('/api/jdgl/queryFjxx', data)
  }

  /**
   * 删除附件信息
   */
  static deleteFjxx(data: FjxxDeleteInputDTO): Promise<commonOutDTO<any>> {
    return axios.post('/api/jdgl/deleteFjxx', data)
  }

  /**
   * 保存复核结果
   */
  static updateFhjg(data: FhjgUpdateInputDTO): Promise<commonOutDTO<any>> {
    return axios.post('/api/jdgl/updateFhjg', data)
  }

  /**
   * 保存结束监督结果
   */
  static updateJsjd(data: JsjdUpdateInputDTO): Promise<commonOutDTO<any>> {
    return axios.post('/api/jdgl/updateJsjd', data)
  }

  /**
   * 保存继续监督结果
   */
  static saveJxjd(data: JxjdSaveInputDTO): Promise<commonOutDTO<any>> {
    return axios.post('/api/jdgl/saveJxjd', data)
  }

  /**
   * 获取处理单明细
   */
  static getCldmx(data: CldmxGetInputDTO): Promise<commonOutDTO<CldmxGetOutputDTO>> {
    return axios.post('/api/jdgl/getCldmx', data)
  }

  /**
   * 获取类型列表
   */
  static queryLxlb(): Promise<commonOutDTO<LxlbQueryResult[]>> {
    return axios.post('/api/jdgl/queryLxlb')
  }

  /**
   * 查询归档监督预警反馈列表
   */
  static queryGdjdyjfklb(
    data: pageCommonInputDTO<GdjdyjfklbQueryParam>,
  ): Promise<commonOutDTO<pageCommonOutDTO<GdjdyjfklbQueryResult[]>>> {
    return axios.post('/api/jdgl/queryGdjdyjfklb', data)
  }

  /**
   * 附件上传
   */
  static uploadFj(data: FjUploadInputDTO): Promise<commonOutDTO<any>> {
    return axios.post('/api/jdgl/uploadFj', data)
  }
}
